package com.zhoup.controller;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import com.zhoup.pojo.User;
import com.zhoup.service.UserServiceI;

@Controller  
@RequestMapping("/user")  
public class UserController {  
   @Resource  
   private UserServiceI userService;  
     
   @RequestMapping("/showUser")  
   public String toIndex(HttpServletRequest request,Model model){  
       int userId = Integer.parseInt(request.getParameter("id"));  
       User user = this.userService.selectByID(userId);  
       model.addAttribute("user", user);  
       return "showUser";  
   }  
   @RequestMapping("/show")  
   public String Index(){  
    
       return "one";  
   }  
   @RequestMapping("/two")  
   public String Index2(){  
    
       return "two";  
   }  
}  